﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
	<c:set var="basePath" value="<%=request.getContextPath()%>"/>
	<!-- jsp文件头和头部 -->
	<jsp:include page="../common/common_head.jsp"/>
	<script type="text/javascript" src="${basePath}/js/base/log.js"></script>
	<script type="text/javascript" src="${basePath}/js/base/dialog.js"></script>
	<script type="text/javascript" src="${basePath}/js/sync/sync_list.js"></script>
	
	</head> 
<body>


<div class="container-fluid" style="padding-top: 10px;">
    <div class="panel panel-primary">
        <%--<div class="panel panel-default">--%>
        <div class="panel-heading">
            <h3 class="panel-title">异构数据同步-jar</h3>
        </div>
        
		
        <ul class="list-group">
            <div class="list-group-item">
                               
                <div class="modal-body">
				<form id="jar_file"  class="form-horizontal" role="form" enctype="multipart/form-data">
				<div class="form-group">
				    <label for="sourceCode" class="col-sm-2 control-label">consumer.xml 名称 </label>
				    <div class="col-sm-10">
				      <input type="text" class="form-control" id="consumerName" name="consumerName"/>
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label for="sourceName" class="col-sm-2 control-label">上传</label>
				    <div class="col-sm-10">
                       <input id="input-5" type="file" name="uploadJar" multiple class="file form-control" data-show-preview="false">
                        <script>
                        //$(function () {
                        	
                        	$("#input-5").fileinput({
                                showRemove: false,
                                uploadUrl:"${basePath}/sync/importJar.do",//上传的地址
                                uploadAsync: true,
                                language : "zh",//设置语言
                                showCaption: true,//是否显示标题
                                showUpload: false, //是否显示上传按钮
                                browseClass: "btn btn-primary", //按钮样式 
                                allowedFileExtensions: ["jar"], //接收的文件后缀
                                maxFileCount: 1,
                                showPreview: false,
                               
                                
                            }).on("fileuploaded", function(event, data) {
                            	alert(data.response.message);
								window.location.href="${basePath}/sync/syncTemplateList.do";
                               }).on('filepreajax', function(event, previewId, index) {
									 alert($("#consumerName").val());
                               });
                        //});
                            
                            
                           
                        </script>				   
                       </div>
				  </div>
				   <div class="form-group">
				   		 <label for="sourceName" class="col-sm-2 control-label"></label>
				   		<div class="col-sm-10">
				   			<a href="javascript:void(0)"  id="importJar" class="btn btn-primary">保存</a>
				        </div>
				   </div>
				</form>
            </div>
            </div>
        </ul>

       

        
    </div>

                                
<!-- 上传jar -->
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModal3Label" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">上传jar</h4>
            </div>
            <div class="modal-body">
				<form id="jar_file"  class="form-horizontal" role="form" enctype="multipart/form-data">
				<div class="form-group">
				    <label for="sourceCode" class="col-sm-2 control-label">consumer.xml 名称 </label>
				    <div class="col-sm-10">
				      <input type="text" class="form-control" id="consumerName" name="consumerName"/>
				    </div>
				  </div>
				  
				  <div class="form-group">
				    <label for="sourceName" class="col-sm-2 control-label">上传</label>
				    <div class="col-sm-10">
                       <input id="input-5" type="file" name="uploadJar" multiple class="file form-control" data-show-preview="false">
                        <script>
                        //$(function () {
                        	
                        	$("#input-5").fileinput({
                                showRemove: false,
                                uploadUrl:"${basePath}/sync/importJar.do",//上传的地址
                                uploadAsync: true,
                                language : "zh",//设置语言
                                showCaption: true,//是否显示标题
                                showUpload: false, //是否显示上传按钮
                                browseClass: "btn btn-primary", //按钮样式 
                                allowedFileExtensions: ["jar"], //接收的文件后缀
                                maxFileCount: 1,
                                showPreview: false,
                               
                                
                            }).on("fileuploaded", function(event, data) {
                            	alert(data.response.message);
								window.location.href="${basePath}/sync/syncTemplateList.do";
                               }).on('filepreajax', function(event, previewId, index) {
									 alert($("#consumerName").val());
                               });
                        //});
                            
                            
                           
                        </script>				   
                       </div>
				  </div>
				  
				 
				</form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<!--                 <button type="submit" class="btn btn-primary">保存</button>
 -->                <a href="javascript:void(0)"  id="importJar" class="btn btn-primary">保存</a>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


</div>
</body>
</html>
<script type="text/javascript">


</script>


